<include file="Public/header" /> 

<!--主窗体-->
<div class="container app">
	<!--左侧菜单-->
	<include file="Public/sidebar" /> 
	<!--左侧菜单//-->	
	
	<!-- mainCon -->
	<div id="mainCon" class="mainCon">
		<h4>会员下级列表</h4>
		<div class="panel panel-default">
			<div class="panel-heading">
				<div>
				当前会员：<{$user_info['username']}>
				&nbsp;&nbsp;&nbsp;&nbsp;
				微信号：<{$user_info['weixin']}> 
				&nbsp;&nbsp;&nbsp;&nbsp;
				手机号码：<{$user_info['mobile']}>
				&nbsp;&nbsp;&nbsp;&nbsp;
				会员等级：<{$level_list[$user_info['level']]}> 
				&nbsp;&nbsp;&nbsp;&nbsp;
				下级人数：<{$down_member_num}> 人
				</div>
			</div>
		</div>

		<table class="table table-bordered table-hover">
			<tr>
				<th>编号</th>
				<th>手机号码</th>
				<th>昵称</th>
				<th>微信号</th>
				<th>注册时间</th>
				<th>会员等级</th>
				<!-- <th>审核状态</th> -->
				<!--<th>状态</th>
				<th>操作</th>-->
			</tr>
			
			<empty name="down_member_list">
				<tr><td colspan="6" style="text-align:center;color:#999">～暂无数据～</td></tr>
			<else /> 
			
				<foreach name="down_member_list" item="vo">
					<tr>
						<td><{$vo['id']}></td>
						<td><{$vo['mobile']}></td>
						<td><{$vo['username']}></td>
						<td><{$vo['weixin']}></td>
						<td><{$vo['createtime']|date="Y-m-d H:i:s",###}></td>
						<td>
							<{$level_list[$vo['level']]}>
						</td>
						<!-- <td>
						<if condition="$vo['status'] eq 1">
							审核通过
						<elseif condition="$vo['status'] eq -1" />
							审核不通过
						<else />
							审核中
						</if>
						</td>
						<td>
							<if condition="$vo['disable'] eq 1">
								锁定	
							<else />
								正常
							</if>
						</td>
						<td>
							<a href="<{:U('Admin/User/downMember',array('uid'=>$vo['id'],'k'=>2,'sk'=>0))}>">下级</a>
							&nbsp;&nbsp;
							<if condition="$vo['disable'] eq 1">
								<a href="javascript:void(0)" class="userLock" data-disable="0" data-id="<{$vo['id']}>">解锁</a>
							<else />
								<a href="javascript:void(0)" class="userLock" data-disable="1" data-id="<{$vo['id']}>">锁定</a>
							</if>
							&nbsp;&nbsp;
							<a href="<{:U('Admin/User/memberInfo',array('uid'=>$vo['id'],'k'=>2,'sk'=>3))}>">编辑</a>
						</td>
						 -->
					</tr>
				</foreach>
			
			</empty> 
			
			
		</table>
		
		<div class="pagebar">
			<{$pager}>
		</div>
		
	</div>
	<!-- mainCon// -->
	
</div>
<!--主窗体//-->

<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>

$(function(){

	var start = {
		elem: '#start_time',
		format: 'YYYY/MM/DD hh:mm:ss',
		istime: true,
		istoday: false,
		choose: function(datas){
			 end.min = datas; //开始日选好后，重置结束日的最小日期
			 end.start = datas //将结束日的初始值设定为开始日
		}
	};
	var end = {
		elem: '#end_time',
		format: 'YYYY/MM/DD hh:mm:ss',
		istime: true,
		istoday: false,
		choose: function(datas){
			start.max = datas; //结束日选好后，重置开始日的最大日期
		}
	};
	laydate(start);
	laydate(end);

	$(".userLock").click(function(){
		var disable = $(this).attr("data-disable");
		var uid = $(this).attr("data-id");
		if(disable == 0){
			var msg = "您是否确定锁定该会员？锁定后该会员将无法登录。";	
		}else{
			var msg = "您是否确定启用该会员？启用后该会员可以正常使用。";	
		}
		layer.confirm(msg, {icon: 3, title:'提示'}, function(index){
			$.post("<{:U('Admin/User/memberLock')}>",{"disable":disable,"uid":uid},function(r){
				if(r.error == 1){
					layer.close(index);
					layer.alert(r.errmsg,{icon: 2});
				}else{
					window.location.reload();
				}
			});
		});
		return false;
	});
});
</script>

<include file="Public/footer" /> 